package com.zjitc.controller;

import com.zjitc.model.User;
import com.zjitc.service.UserService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/4/9 14:49
 * @description:
 */
@Controller
public class UserController {

  @Autowired
  private UserService userService;

  @RequestMapping("/insert")
  @ResponseBody
  public String insertUser(){
    int count=userService.insertUser();
    return "插入成功";
  }

  @RequestMapping("/findByDataBase")
  @ResponseBody
  public List<User> findByDataBase(){
    List<User> list=userService.findByDataBase();
    return list;
  }

  @RequestMapping("/findUserAll")
  @ResponseBody
  public List<User> findUserAll(){
    List<User> list=userService.findUserAll();
    return list;
  }


}
